<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/viewOrder.do"/>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.sales.forms.ApproverOrderForm,
                 com.scalar.chiptrack.users.Functionality,
                 com.scalar.chiptrack.users.User,
                 com.scalar.chiptrack.commons.Constants,
                 com.scalar.chiptrack.commons.SessionKeys"%>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<script language="JavaScript">
    // Modified popup window names acc to usage by veeru on 6th April 2004
    function openSalesOrder()
    {

        var temp = eval(document.approverOrderForm["salesOrder.salesOrderId"]);
        var salesOrderId = temp.value;
		 var temp1 = eval(document.approverOrderForm["salesOrder.salesOrderNo"]);
        var salesOrderNo = temp1.value;
        var isSample     = document.approverOrderForm.isSample.value;
    //newWindow =
    window.open('order.do?action=printOrder&salesOrderId='+salesOrderId+'&salesOrderNo='+salesOrderNo+'&isSample='+isSample,'optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=400,left=100,top=50,resizable=yes');
  	//newWindow.moveTo(100,50);
  	//newWindow.focus();
    }

    function openReasonCodes()
    {
        newWindow = window.open('reasonCodes.do?action=Show','reasonCodesPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,top=0,left=0,height=300,widht=500,resizable=yes');
	newWindow.focus();
    }

    function openAuditTrail()
    {
        var temp = eval(document.approverOrderForm["salesOrder.salesOrderNo"]);
        var salesOrderNo = temp.value;
        var salesOrderId = document.approverOrderForm.salesOrderId.value;
        var isSample     = document.approverOrderForm.isSample.value;
        newWindow=window.open('salesAuditTrail.do?salesOrderId='+salesOrderId+'&salesOrderNo='+salesOrderNo+'&isSample='+isSample,'auditTrailPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=600,height=700,left=100,top=50,resizable=yes');
  	    //newWindow.moveTo(100,50);
  	    newWindow.focus();
    }

// SharatH on July 31, 2003
function showErrorReportPage()
{
    newWindow = window.open ('<%=chipTracContext%>/reportProblem.do','reportProblem','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=750,height=400,resizable=no');
    newWindow.focus();
}

</script>

<!-- Top Header Start -->
    <%
        String userTypeChiptrac = Constants.USER_TYPE_CHIPTRAC + "";
    %>
    <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/includes/header.jsp" %>
    </logic:equal>
    <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/includes/extHeader.jsp" %>
    </logic:notEqual>

<!-- Top Header End -->
<% User user1 = (User) session.getAttribute (SessionKeys.USER_KEY); %>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigations start -->
<%
 String heading = "";
 String isSample = "1";
%>
<% if((request.getParameter("isSample") != null) && (request.getParameter("isSample").equals("0"))) {
    heading = "Sample Order"; isSample="0";
%>
	    <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/sample_order_menu.jsp" %>
        </logic:equal>
        <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/ext_sample_order_menu.jsp" %>
        </logic:notEqual>
<% } else {
    heading = "Sales Order";isSample="1";
%>
        <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/sales_order_menu.jsp" %>
        </logic:equal>
        <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/ext_sales_order_menu.jsp" %>
        </logic:notEqual>
<% } %>


</TD>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<html:html>

<!-- from here your body starts -->
<html:form name="approverOrderForm" action="/approveOrder" method="post" type="com.scalar.chiptrack.sales.forms.ApproverOrderForm">
 <% ApproverOrderForm salesOrderForm = (ApproverOrderForm) request.getAttribute("approverOrderForm"); %>
<table width=80%><tr><td ><center><span class="NArialW"><%=heading%> Details</span></center></td></table>

<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>
   <nested:nest property="salesOrder">
   <table border="0" width="90%" align=right>
    <%boolean showMessage = request.getAttribute("showMessage")!=null&&"true".equalsIgnoreCase((String)request.getAttribute("showMessage"));
        if(showMessage){
    %>

        <tr><td colspan=7 align='left'>
        <font class='NArialS'>
        <font color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b>
        </font></font></td></tr>
    <%}%>
     <tr>
       <td width="21%"><font class="NArialL">Sales Order No :</font></td>
       <td width="21%" class="bodytext"><b><nested:write property="salesOrderNo" /></b>
            <nested:hidden property="salesOrderId" /><nested:hidden property="salesOrderNo"/></td>
       <!-- <td width="3%">&nbsp;</td> -->
       <td width="21%"><font class="NArialL">Customer Name :</font></td>
       <td width="21%" class="bodytext"><nested:write property="customerName" /></td>
        <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Customer PO No :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="customerPO"/></font></td>
       <!-- <td width="3%">&nbsp;</td> -->
       <td width="21%"><font class="NArialL">Contact Person :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="contactPerson"/></font></td>
        <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
     <!-- <nested:define id="soNo" property="salesOrderNo"/>
     <tr><td colspan=4><font class="NArialL">Please <chiptrack:attachFile fileGroup="SalesOrder-PO" fileSubGroup="<%=soNo%>" formTitle="Attach Sales PO" linkText="click here" allowAttach="<%=!showMessage%>" allowDelete="<%=!showMessage%>"/> to View and Attach PO</font></td></tr> -->
     <tr>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoRevisionNumber"/> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write  property="poRev"/></font></td>
       <!-- <td width="3%">&nbsp;</td> -->
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoDate"/> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write  property="poDate"/></font></td>
       <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Phone :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="phoneNumber" /></td>
       <!-- <td width="3%">&nbsp;</td> -->
       <td width="21%"><font class="NArialL">Cell No :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="cellNumber" /></td>
	   <td width="3%">&nbsp;</td>
   	   <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Fax :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="faxNumber" /></td>
       <!-- <td width="3%">&nbsp;</td> -->
       <td width="21%"><font class="NArialL">Email :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="email" /></td>
	   <td width="3%">&nbsp;</td>
	   <td width="3%">&nbsp;</td>
     </tr>
	  <tr><!-- Added by Sarada on 8th March 2004  -->
	   <td width="21%"><font class="NArialL">Sales Person :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesPerson" /></td>
	   <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesRep.Name"/> :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesRep" /></td>
       <td width="3%">&nbsp;</td>
	   <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.ShippingMethod" /> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="shippingMethod" /></font></td>
       <td width="21%"><font class="NArialL">Regional Rep : </font></td>
       <td width="21%" class="bodytext"><nested:write property="regionalRep" />
        <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>    
	 <tr>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.userField1" /> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="userField1"/></font></td>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.userField2" /> :</td>
       <td width="21%"><font class="bodytext"><nested:write property="userField2"/></font></td>
       <td width='3%'>&nbsp;</td>
       <td width='3%'>&nbsp;</td>
     </tr>
   <tr>
       <nested:equal value="-2" property="endCustomerId">
           <td width="21%" class="NArialL">Add New <bean:message key="label.sales.endUser"/> :</td>
           <td width="21%" class="bodytext"><nested:write property="newEndUserName"  /></td>
       </nested:equal>
       <nested:notEqual value="-2" property="endCustomerId">
           <td width="21%"><font class="NArialL"><bean:message key="label.sales.endUser"/> :</font></td>
           <td width="21%" class="bodytext"><nested:write property="endCustomer"  /></td>
       </nested:notEqual>       
        <nested:equal value="-2" property="odmId">
            <td width="21%" class="NArialL">Add New <bean:message key="label.sales.shipToCustomer"/></td>
            <td width="21%" class="bodytext"><nested:write property="newEndCustomerName" /></td>
        </nested:equal>
        <nested:notEqual value="-2" property="odmId">
            <td width="21%"><font class="NArialL"><bean:message key="label.sales.shipToCustomer"/></font></td>
            <td width="21%" class="bodytext"><nested:write property="odm" /></td>
        </nested:notEqual>
       <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
    <tr>
       <td width="21%"><font class="NArialL">Pay Terms :</font></td>
       <td width="21%" class="bodytext">
            <nested:notEqual property="shippingTerms" value="-1" >
                <nested:write property="shippingTerms"  />
            </nested:notEqual>
       </td>
       <td width="21%"><font class="NArialL"><bean:message key="label.sales.salesOrder.DeliveryTerms" /> : </font></td>
       <td width="21%" class="bodytext"><nested:write property="deliveryTerms" /></td>
       <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
    </tr>
    <tr>
        <td width="21%"><font class="NArialL"></font></td>
        <td width='21%' class="bodytext"></td>
        <nested:equal value="true" name="salesOrderForm" property="isConsignee">
        <td width="21%" class="NArialL">Invoice to Customer : </td>
            <td width="21%" class="bodytext">
                <nested:equal value="0" name="salesOrderForm" property="isConsignmentSales">No</nested:equal>
                <nested:notEqual value="0" name="salesOrderForm" property="isConsignmentSales">Yes</nested:notEqual>
            </td>
        </nested:equal>
        <nested:notEqual value="true" name="salesOrderForm" property="isConsignee">
            <td width="21%">&nbsp;</td>
            <td width="21%">&nbsp;</td>
        </nested:notEqual>
        <td width="3%">&nbsp;</td>
    </tr>
    <tr>
        <td width="21%"><font class="NArialL">Booking Date :</font></td>
        <td width='21%' class="bodytext"><nested:write property="salesOrderDate"/></td>
        <td width="21%"><font class="NArialL">Quotation No :</font></td>
        <td width="21%" class="bodytext">
            <nested:notEqual value="null" name="salesOrderForm" property="quotationNo">
                <nested:write name="salesOrderForm" property="quotationNo" />
            </nested:notEqual>
        </td>
        <td width="3%">&nbsp;</td>
        <td width="3%">&nbsp;</td>
    </tr>
     <tr>
       <td width="21%" valign="top"><font class="NArialL">Billing Address :</font></td>
       <td width="21%" valign="top"><font class="bodytext">
        <!-- < nested:write property="billingAddress"/></font> -->
        <% ApproverOrderForm approveOrderForm = (ApproverOrderForm) request.getAttribute("approverOrderForm"); %>
        <%=approveOrderForm.getSalesOrder().getBillingAddressAsHTML()%>
        </font></td>
       <!-- <td width="3%">&nbsp;</td> -->
       <td width="21%" valign="top"><font class="NArialL">Shipping Address :</font></td>
       <td width="21%" valign="top"><font class="bodytext">
           <!--  < nested:write property="shippingAddress" /></font> -->
           <%=approveOrderForm.getSalesOrder().getShippingAddressAsHTML()%></font>
       </td>
        <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr><td colsapn=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
     <tr>
       <td width="21%"><font class="NArialL">Freight Instructions :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="freightInstructions" /></font></td>
       <td width="21%"><font class="NArialL">Shipping Instructions :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="shippingInstructions" /></font></td>
       <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="21%"><font class="NArialL">Comments :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="comments" /></font></td>
       <td width="21%">&nbsp;</td>
       <td width="21%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
      <%
        String commentsGroupId = "SalesOrder-" + salesOrderForm.getSalesOrderNo();
      %>
       <tr><td colspan=4><chiptrack:internalComments commentsGroupId="<%=commentsGroupId%>"/></td></tr>
     </nested:nest>
     <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
     <tr><td colspan=6 class="NArialL"> <A HREF="javascript:openAuditTrail();" onmouseover="window.status='Click to Audit Trail';return true" onmouseout="window.status='';return true" >
        Audit Trail</a></td></tr>
     <logic:equal name="cancelledShow" value="TRUE">
     <tr><td colspan=6 class="NArialL">Cancelled LineItems</td></tr>
     <tr><td colspan=6>
        <table border="0" width="100%" bordercolor="#FFFFFF">
	 <tr>
	   <td width="5%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Line Item</font></font></td>

	   <td width="10%" align="center" bgcolor="#993333" nowrap><font class="NArialL" >
			<font color="#FFFFFF"><bean:message key="label.mfgPartNumber" /></font></font>
	   </td>
        <td width="10%" align="center" bgcolor="#993333" nowrap><font class="NArialL" >
        <font color="#FFFFFF">
            <!-- Modified by veeru on (03/08/04)
            Customer PartNo -->
            <bean:message key="label.customerPartNumber"/>
        </font></font></td>

           <!-- <td width="10%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Description</font></td> -->
       <td width="1%" align=center bgcolor='#993333' class="NArialL">
                <font color="#FFFFFF">Taxable</font></td>
	   <td width="7%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Quantity</font></font></td>
	   <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Price </font></font></td>
	   <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Amount</font></font></td>
           <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Req'd Dock Date</font></font></td>
           <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Schedule Date</font></font></td>
           <td width="20%" align="center" bgcolor="#993333"><font class="NArialL">
            <font color="#FFFFFF">Status</font></font></td>
         </tr>
         <logic:iterate id="LineItem" name="cancelledLineItems">
         <tr>
	   <td width="5%" bgcolor="#DEE1E2" align=center >
                <font class="NArialL"><bean:write name="LineItem" property="lineItemNo" /></font></td>
	   <td width="10%" bgcolor="#DEE1E2" nowrap>
                <font class="NArialL"><bean:write name="LineItem" property="manufacturingPartNo" /></font></td>
      <td width="10%" bgcolor="#DEE1E2" nowrap>
                <font class="NArialL"><bean:write name="LineItem" property="customerPartNo" /></font></td>
      <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
      <td width="10%" bgcolor="#DEE1E2" nowrap>
                <font class="NArialL"><bean:write name="LineItem" property="labelNumber" /></font></td>
      <%}%>
           <!-- <td width="10%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="lineItemDescription" /></font></td> -->
           <td width="1%" bgcolor="#DEE1E2" class="NArialL" align=center>
                <bean:write name="LineItem" property="isTaxableAsString"/></td>
	   <td width="7%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="qtyAsString" /></font></td>
	   <td width="12%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="unitPriceAsString" /></font></td>
           <td width="12%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="amountAsString" /></font></td>
           <td width="12%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="requestDate" /></font></td>
           <td width="12%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="scheduleDate" /></font></td>
           <td width="20%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="status" /></font>
           </td>
         </tr>
         </logic:iterate>
        </table>
     </td>
     </tr>
     </logic:equal>
    <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
     <logic:equal name="changedShow" value="TRUE">
     <tr><td colspan=6 class="NArialL">Changed LineItems</td></tr>
     <tr><td colspan=6>
        <table border="0" width="100%" bordercolor="#FFFFFF">
	 <tr>
	   <td width="5%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Line Item</font></font></td>

        <td width="5%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">PO Line Item</font></font></td>

	   <td width="10%" align="center" bgcolor="#993333" nowrap><font class="NArialL">
				<font color="#FFFFFF"><bean:message key="label.mfgPartNumber" /></font></font></td>
       <td width="10%" align="center" bgcolor="#993333" nowrap><font class="NArialL">
                <font color="#FFFFFF">
                <!-- Modified by veeru on (03/08/04)
                Customer PartNo -->
                <bean:message key="label.customerPartNumber"/>
                </font></font></td>
           <td width="1%" align=center bgcolor='#993333' class="NArialL">
                <font color="#FFFFFF">Taxable</font></td>
	   <td width="7%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Quantity</font></font></td>
	   <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Price </font></font></td>
	   <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Amount</font></font></td>
           <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Req'd Dock Date</font></font></td>
           <td width="12%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Schedule Date</font></font></td>
           <td width="20%" align="center" bgcolor="#993333"><font class="NArialL">
            <font color="#FFFFFF">Status</font></font></td>

         </tr>
         <logic:iterate id="LineItem" name="changeLineItems">
         <tr>
	   <td width="5%" bgcolor="#DEE1E2" align=center >
                <font class="NArialL"><bean:write name="LineItem" property="lineItemNo" /></font></td>

	   <td width="5%" bgcolor="#DEE1E2" align=center >
                <font class="NArialL"><bean:write name="LineItem" property="poLineItemNo" /></font></td>

	   <td width="10%" bgcolor="#DEE1E2" nowrap>
                <font class="NArialL"><bean:write name="LineItem" property="manufacturingPartNo" /></font></td>
       <td width="10%" bgcolor="#DEE1E2" nowrap>
                <font class="NArialL"><bean:write name="LineItem" property="customerPartNo" /></font></td>
           <td width="1%" bgcolor="#DEE1E2" class="NArialL" align=center>
                <bean:write name="LineItem" property="isTaxableAsString"/></td>
	   <td width="7%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="qtyAsString" /></font></td>
	   <td width="12%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="unitPriceAsString" /></font></td>
           <td width="12%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="amountAsString" /></font></td>
           <td width="12%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="requestDate" /></font></td>
           <td width="12%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="scheduleDate" /></font></td>
           <td width="20%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="status" /></font>
           </td>
         </tr>
         </logic:iterate>
        </table>
     </td>
     </tr>
     </logic:equal>
     <tr><td colspan=6><chiptrack:info styleClass="NArialL" /></td></tr>
     <tr><td colspan=6><chiptrack:errors styleClass="NArialL" /></td></tr>
     <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
     <logic:equal name="presentShow" value="TRUE">
     <tr><td colspan=6 class="NArialL" align=right><A href="javascript:openReasonCodes();"onmouseover="window.status='Click to Reason Codes';return true" onmouseout="window.status='';return true">ReasonCodes Description</A></td></tr>
     <tr><td colspan=6>
        <% int noOfColumnsBeforeQty = 7; %>
        <table border="0" width="100%" bordercolor="#FFFFFF">
	 <tr>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL" nowrap>
                <font color="#FFFFFF">Line Item</font></font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL" nowrap>
                <font color="#FFFFFF">PO Line Item</font></font></td>

	   <td width="10%" align="center" bgcolor="#993333" nowrap><font class="NArialL">
            <font color="#FFFFFF"><bean:message key="label.mfgPartNumber" /></font></font>
	   </td>
        <% if(ConfigManager.getBooleanProperty(ConfigManager.PROP_SHOW_SALES_LINEITEM_MARKETING_PART_NUMBER)) { %>
            <td width="10%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF"><bean:message key="label.mktgPartNumber" /></font></td>
        <% noOfColumnsBeforeQty ++; } %>
       <td width="10%" align="center" bgcolor="#993333" nowrap><font class="NArialL">
                <font color="#FFFFFF">
				<bean:message key="label.customerPartNumber"/>
				</font></font></td>
       <td width="10%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Description</font></font></td>
       <td width="1%" align=center bgcolor='#993333' class="NArialL">
                <font color="#FFFFFF">Taxable</font></td>
       <td width="1%" align=center bgcolor='#993333' class="NArialL">
                <font color="#FFFFFF">Expedite Fee</font></td>
	   <td width="5%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Quantity</font></font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Price </font></font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Amount</font></font></td>
           <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Req'd Dock Date</font></font></td>
           <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Schedule Date</font></font></td>
           <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Revised Ship Date</font></font></td>
           <td width="20%" bgcolor='#993333'>
            <table with="100%" border=0>
                <tr><td colspan=4 class="NArialL" align=center><font color="#FFFFFF">Holds</font></td></tr>
                <font size="-3"><tR><td width="25%" align=left class="NArialL"><font color="#FFFFFF">Mktg</font></td><td  width="25%" align=center class="NArialL"><font color="#FFFFFF">Fin</font></td><td width="25%" align=right class="NArialL"><font color="#FFFFFF">Ops</FONT></td><td  align=right width="25%" class="NArialL"><font color="#FFFFFF">&nbsp;&nbsp;&nbsp;Sales</FONT></td></tr></font>
            </table>
           </td>
         <%
             if(ConfigManager.getBooleanProperty(ConfigManager.PROP_SHOW_SALES_LINEITEM_CUSTOM_PRICE_FIELD1)) {
         %>
            <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF"><bean:message key="label.sales.lineItem.customPriceField1" /></font></td>
         <%
             }
             if(ConfigManager.getBooleanProperty(ConfigManager.PROP_SHOW_SALES_LINEITEM_CUSTOM_TEXT_FIELD1)) {
         %>
                <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF"><bean:message key="label.sales.lineItem.customTextField1" /></font></td>
         <%
             }
         %>
         </tr>

<logic:iterate id="myHashMap" name="lineItemsWithSubtotals">
    <logic:iterate id="lineItemList" name="myHashMap" >
          <logic:iterate id="LineItem" name="lineItemList" property="key" type="com.scalar.chiptrack.sales.LineItem">
         <tr>
       <td width="8%" bgcolor="#DEE1E2" align=center >
                <font class="NArialL"><bean:write name="LineItem" property="lineItemNo" /></font></td>
       <td width="8%" bgcolor="#DEE1E2" align=center >
                <font class="NArialL"><bean:write name="LineItem" property="poLineItemNo" /></font></td>

	   <td width="10%" bgcolor="#DEE1E2" nowrap>
                <font class="NArialL"><bean:write name="LineItem" property="manufacturingPartNo" /></font></td>
         <% if(ConfigManager.getBooleanProperty(ConfigManager.PROP_SHOW_SALES_LINEITEM_MARKETING_PART_NUMBER)) { %>
            <td width="10%" bgcolor="#DEE1E2" nowrap><font class="NArialL"><bean:write name="LineItem" property="marketingPartNo"/></font></td>
         <% } %>
           <td width="10%" bgcolor="#DEE1E2" nowrap>
                <font class="NArialL"><bean:write name="LineItem" property="customerPartNo" /></font></td>
           <td width="10%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="lineItemDescription" /></font></td>
           <td width="1%" bgcolor="#DEE1E2" class="NArialL" align=center>
                <bean:write name="LineItem" property="isTaxableAsString"/></td>
            <td  class="NArialL" bgcolor='#DEE1E2' align=center>
               <logic:equal name="LineItem" property="isExpedite" value="true">
               Yes
               </logic:equal>
               <logic:equal name="LineItem" property="isExpedite" value="false">
               No
               </logic:equal>
            </td>

	   <td width="5%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="qtyAsString" /></font></td>
	   <td width="8%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="unitPriceAsString" /></font></td>
           <td width="8%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="amountAsString" /></font></td>
           <td width="8%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="requestDate" /></font></td>
           <td width="8%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="scheduleDate" /></font></td>

           <td width="8%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="revisedDate" /></font></td>
           <td width="20%" bgcolor="#DEE1E2">
                <table with="100%">
                <tr>
                    <td class="NArialL">
                        <html:select name="LineItem" property="marketingHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="marketingReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                    <td class="NArialL">
                        <html:select name="LineItem" property="financeHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="financeReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                    <td class="NArialL">
                        <html:select name="LineItem" property="operationsHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="opsReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                    <td class="NArialL">
                        <html:select name="LineItem" property="salesHold" styleClass="txfield" disabled="true">
                            <html:option value=""></html:option>
                            <html:option value="0">X</html:option>
                            <html:options collection="salesReasonCodes" property="value" labelProperty="label"/>&nbsp;
                        </html:select>
                    </td>
                </tr>
            </table>
           </td>
         <%
             if(ConfigManager.getBooleanProperty(ConfigManager.PROP_SHOW_SALES_LINEITEM_CUSTOM_PRICE_FIELD1)) {
         %>
            <td width="10%" bgcolor="#DEE1E2" align="right"  class="NArialL">
                <bean:write name="LineItem" property="customPriceField1AsString" />
            </td>
         <%
             }
             if(ConfigManager.getBooleanProperty(ConfigManager.PROP_SHOW_SALES_LINEITEM_CUSTOM_TEXT_FIELD1)) {
         %>
            <td width="15%" bgcolor="#DEE1E2" class="NArialL">
                <bean:write name="LineItem" property="customTextField1" />
            </td>
         <%
             }
         %>
         </tr>
         </logic:iterate>
         <tr>
            <td colspan="<%=noOfColumnsBeforeQty%>" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                Sub Total
            </td>
            <bean:define id="subTotal" name="lineItemList" property="value" type="com.scalar.chiptrack.sales.SubTotal"/>
            <td colspan="1" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                <bean:write name="subTotal" property="subTotalQty" />
            </td>
            <td>&nbsp;</td>
            <td colspan="1" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                <bean:write name="subTotal" property="subTotalAmt" />
            </td>
         </tr>
     </logic:iterate>
</logic:iterate>

    <tr><td colspan=10>&nbsp;</td></tr>

         <%  int colSpan = noOfColumnsBeforeQty+2; %>
         <nested:nest property="salesOrder">
         <tr>
            <td colspan=<%=colSpan%> align=right class="NArialL">Total</td>
            <td bgcolor="#DEE1E2" class="NArialL" align="right"><nested:write property="subTotalAsString" /></td>
        </tr>
        <tr>
            <td colspan=<%=colSpan%> align=right class="NArialL">Sales Tax</td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right"><nested:write property="salesTaxAsString" /></td>
        </tr>
        <tr>
            <td colspan=<%=colSpan%> align=right class="NArialL">Freight</td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right"><nested:write property="frieghtAsString" /></td>
        </tr>
        <tr>
            <td colspan=<%=colSpan%> align=right class="NArialL">
                    <nested:write name="salesOrderForm" property="miscName"/>
                </td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right"><nested:write property="miscAsString" /></td>
        </tr>
        <tr>
            <td colspan=<%=colSpan%> align=right class="NArialL">Order Total</td>
            <td bgcolor='#DEE1E2' class="NArialL" align="right"><nested:write property="orderTotalAsString" /></td>
        </tr>
        </nested:nest>

        </table>
     </td>
     </tr>
     <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
     </logic:equal>

     <tr>

  <%  String[] coolstatus = null;
       boolean statusFlag =false;
       int cnt = 0;
     	try
     	 {


     		coolstatus = (String[])request.getAttribute("lineitemstatus");
     		for(int i=0;i<coolstatus.length;i++)
     		{
     		//out.println(coolstatus[i] );
     		if((coolstatus[i].equalsIgnoreCase("SHIPPED")))
     		{
     		statusFlag = true;
     		}
     		else
     		{
     		statusFlag = false;
     		cnt++;

     		 }
     		}
     	 }
     	 catch(NullPointerException e)
     	 {
     	 	//coolstatus = "XYZ";
     	 }
     	 coolstatus = (String[])request.getAttribute("lineitemstatus");

         if( (statusFlag == true) && (cnt == 0) ) {
         %>
	   <td colspan=3 class='NArialL'>&nbsp;&nbsp;
           <!--Scriptlet in the else condition added by Bhaskar on 9 july 2003-->
          <% } else {
          ApproverOrderForm subForm = ( ApproverOrderForm ) request.getAttribute( "approverOrderForm" );
          int salesOrderId = subForm.getSalesOrderId();
		  String salesOrderNo = subForm.getSalesOrderNo();


          int isSamples = Integer.parseInt(request.getParameter("isSample").trim());
          %>
        <logic:equal name="presentShow" value="TRUE">
        <td colspan=3 class='NArialL'>
        <!--Scriptlet added by Bhaskar on 16 july 2003-->
        <% if ( isSamples == 1 && user1.isActionAllowed ( Functionality.SALES_MISSED_ORDER, User.USER_ACTION_MODIFY ) ) { %>
        <chiptrack:restrictedLink functionality='<%=Functionality.SALES_VIEW_ORDER%>' action='<%=User.USER_ACTION_MODIFY%>' styleClass="leftsection" href='<%=chipTracContext + "/approveOrder.do?action=missedOrder&salesOrderId=" + salesOrderId +"&salesOrderNo=" + salesOrderNo +"&isSample=" + isSamples%>' onmouseover="window.status='Click to enter revised dates';return true" onmouseout="window.status='';return true">Click here to enter revised dates </chiptrack:restrictedLink>
        <% } else if ( isSamples == 0 && user1.isActionAllowed ( Functionality.SAMPLE_MISSED_ORDER, User.USER_ACTION_MODIFY ) ) { %>
        <chiptrack:restrictedLink functionality='<%=Functionality.SAMPLE_VIEW_ORDER%>' action='<%=User.USER_ACTION_MODIFY%>' styleClass="leftsection" href='<%=chipTracContext + "/approveOrder.do?action=missedOrder&salesOrderId=" + salesOrderId +"&salesOrderNo=" + salesOrderNo +"&isSample=" + isSamples%>' onmouseover="window.status='Click to enter revised dates';return true" onmouseout="window.status='';return true">Click here to enter revised dates </chiptrack:restrictedLink>
        <% }  %>
        </logic:equal><% } %>
        </td>


        <td colspan=3 class="NArialL">
            <A HREF="javascript:openSalesOrder();" onmouseover="window.status='Click to Print/View Sales Order';return true" onmouseout="window.status='';return true" >Click here for printable version</a></td>
        </tr>
        <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
    </table>

<input type="hidden" name="isSample" value="<%=request.getParameter("isSample")%>">
<html:hidden name="approverOrderForm" property="salesOrderId" />
<%-- html:hidden name="approverOrderForm" property="salesOrderNo" --%>
</html:form>
</html:html>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->

</BODY>
</HTML>
